import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  // {
  //   path: "/login",
  //   name: "login",
  //   component: () => import("@/views/login/index"),
  // },
  {
    path: '/',
    name: 'Home',
    redirect: "/home",
    component: () => import('../views/index.vue'),
    children:[
      {
        path: "/home",
        name: "home",
        component: () => import("@/views/home/index"),
        meta:{
          keepAlive:true //支持缓存
        }
      },
      {
        path: "/news",
        name: "news",
        component: () => import("@/views/news/index"),
        meta:{
          keepAlive:true //支持缓存
        }
      },
      {
        path: "/news/details",
        name: "newsDetails",
        component: () => import("@/views/news/details"),
        meta:{
          keepAlive:true //支持缓存
        }
      },
      {
        path: "/case",
        name: "case",
        component: () => import("@/views/case/index"),
        meta:{
          keepAlive:true //支持缓存
        }
      },
      {
        path: "/case/details",
        name: "caseDetails",
        component: () => import("@/views/case/details"),
        meta:{
          keepAlive:true //支持缓存
        }
      },
      {
        path: "/contact",
        name: "contact",
        component: () => import("@/views/contact/index"),
        meta:{
          keepAlive:true //支持缓存
        }
      },
      {
        path: "/qualifications",
        name: "qualifications",
        component: () => import("@/views/qualifications/index"),
        meta:{
          keepAlive:true //支持缓存
        }
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
